<?php
include_once '../common_mbs.inc.php';
include_once '../smarty.inc.php';

//判断访问权限
$admin_index_module_obj = new osgh_admin_index_module_cls();
$is_warrant = $admin_index_module_obj->is_have_warrant($_ADMIN_ID,'company_list');
if(!$is_warrant) tcmc_cls::ShowMsg("没有权限访问！", "../index_body.html");


$company_obj = new company_cls();
$company_name = isset($_REQUEST['company_name']) ? trim($_REQUEST['company_name']) : '';
$where_str = "company_name like '%{$company_name}%'";
$count = $company_obj->get_company_list(true, $where_str);
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$p = new show_page_cls;
$page_size = 30;
$p -> pvar="page";
$p -> setvar(array("company_name"=>$company_name));
$p -> set($page_size,$count,$page);
$page_str = $p -> output(true);
$limit = $p -> limit();

$companyList = $company_obj->get_company_list(false, $where_str, 'add_time desc', $limit);

$smarty -> assign('company_name' , $company_name);
$smarty -> assign('company_list', $companyList);
$smarty -> assign('page_str' , $page_str);
$smarty -> display('user/company_list.tpl');

?>
